//
//  SISSPublicMethods.m
//  SISSAPP
//
//  Created by 袁应荣 on 15/01/2018.
//  Copyright © 2018 优房网. All rights reserved.
//

#import "SISSPublicMethods.h"

@implementation SISSPublicMethods

+ (UIColor *)matchTextColorWithHouseFeatureStr:(NSString *)str {
    UIColor *color;
    if ([str isEqualToString:@"紧邻地铁"]) {
        color = COLOR(0x33B189);
    } else if ([str isEqualToString:@"南北通透"]) {
        color = COLOR(0xF76D81);
    } else if ([str isEqualToString:@"支持月付"]) {
        color = COLOR(0x8E7FFF);
    } else if ([str isEqualToString:@"拎包入住"]) {
        color = COLOR(0x59ABFD);
    } else if ([str isEqualToString:@"可短租"]) {
        color = COLOR(0xE46B00);
    } else if ([str isEqualToString:@"随时看房"]) {
        color = COLOR(0xC43A18);
    }
    return color;
}

/*
 {
 UIKeyboardTypeDefault,                // Default type for the current input method.
 UIKeyboardTypeASCIICapable,           // Displays a keyboard which can enter ASCII characters
 UIKeyboardTypeNumbersAndPunctuation,  // Numbers and assorted punctuation.
 UIKeyboardTypeURL,                    // A type optimized for URL entry (shows . / .com prominently).
 UIKeyboardTypeNumberPad,              // A number pad with locale-appropriate digits (0-9, ۰-۹, ०-९, etc.). Suitable for PIN entry.
 UIKeyboardTypePhonePad,               // A phone pad (1-9, *, 0, #, with letters under the numbers).
 UIKeyboardTypeNamePhonePad,           // A type optimized for entering a person's name or phone number.
 UIKeyboardTypeEmailAddress,           // A type optimized for multiple email address entry (shows space @ . prominently).
 UIKeyboardTypeDecimalPad NS_ENUM_AVAILABLE_IOS(4_1),   // A number pad with a decimal point.
 UIKeyboardTypeTwitter NS_ENUM_AVAILABLE_IOS(5_0),      // A type optimized for twitter text entry (easy access to @ #)
 UIKeyboardTypeWebSearch NS_ENUM_AVAILABLE_IOS(7_0),    // A default keyboard type with URL-oriented addition (shows space . prominently).
 UIKeyboardTypeASCIICapableNumberPad NS_ENUM_AVAILABLE_IOS(10_0), // A number pad (0-9) that will always be ASCII digits.
 
 UIKeyboardTypeAlphabet = UIKeyboardTypeASCIICapable, // Deprecated
 
 }
 */
+ (UIKeyboardType)matchKeybordTypeWithKeyboardNum:(NSInteger)num {
    
    switch (num) {
        case 1:
            return UIKeyboardTypeDefault;
        case 2:
            return UIKeyboardTypeASCIICapable;
        case 3:
            return UIKeyboardTypeNumbersAndPunctuation;
        case 4:
            return UIKeyboardTypeURL;
        case 5:
            return UIKeyboardTypeNumberPad;
        case 6:
            return UIKeyboardTypePhonePad;
        case 7:
            return UIKeyboardTypeNamePhonePad;
        case 8:
            return UIKeyboardTypeEmailAddress;
        case 9:
            return UIKeyboardTypeDecimalPad;
        case 10:
            return UIKeyboardTypeTwitter;
        case 11:
            return UIKeyboardTypeWebSearch;
        case 12:
            return UIKeyboardTypeASCIICapableNumberPad;
            
        default:
           return UIKeyboardTypeDefault;
    }
}

@end
